/*   1:    */ package com.rinsi.app.azsb.clbztzs;
/*   2:    */ 
/*   3:    */ import com.rinsi.core.service.CoreSimpleService;
/*   4:    */ import com.rinsi.util.FormaterUtil;
/*   5:    */ import com.rinsi.util.MapUtil;
/*   6:    */ import java.util.Date;
/*   7:    */ import java.util.Map;
/*   8:    */ import org.mybatis.spring.SqlSessionTemplate;
/*   9:    */ import org.springframework.stereotype.Service;
/*  10:    */ 
/*  11:    */ @Service("clbztzsTxService")
/*  12:    */ public class ClbztzsService
/*  13:    */   extends CoreSimpleService
/*  14:    */ {
/*  15:    */   public void afterIndex(Map<String, Object> model, Map<String, Object> rMap)
/*  16:    */   {
/*  17: 16 */     Map<String, Object> params = getParams(model);
/*  18:    */     
/*  19: 18 */     Map<String, Object> config = getConfig(model);
/*  20:    */     try
/*  21:    */     {
/*  22: 22 */       Map<String, Object> data = (Map)getSqlSessionTemplate().selectOne(namespace(config) + ".list", params);
/*  23:    */       
/*  24: 24 */       Integer allDatas = (Integer)getSqlSessionTemplate().selectOne(namespace(config) + ".selectOrganNo", params);
/*  25:    */       
/*  26: 26 */       allDatas = Integer.valueOf(allDatas.intValue() + 1);
/*  27:    */       
/*  28: 28 */       String temp = "";
/*  29: 30 */       if (allDatas.intValue() < 10) {
/*  30: 32 */         temp = "000" + allDatas;
/*  31: 34 */       } else if ((10 <= allDatas.intValue()) && (allDatas.intValue() < 100)) {
/*  32: 36 */         temp = "00" + allDatas;
/*  33: 38 */       } else if ((100 <= allDatas.intValue()) && (allDatas.intValue() < 1000)) {
/*  34: 40 */         temp = "0" + allDatas;
/*  35:    */       } else {
/*  36: 44 */         temp = String.valueOf(allDatas);
/*  37:    */       }
/*  38: 48 */       rMap.put("UNAME", getSqlSessionTemplate().selectOne(namespace(config) + ".getUserName", params));
/*  39:    */       
/*  40: 50 */       params.put("AQSCXKZSCS_SCYJ", "不符合规定");
/*  41:    */       
/*  42: 52 */       rMap.put("STZL", getSqlSessionTemplate().selectOne(namespace(config) + ".stzl", params));
/*  43:    */       
/*  44: 54 */       data.put("TZS_BH", "【" + FormaterUtil.formatDateValue(new Date(), "yyyy") + " 】 " + temp);
/*  45:    */       
/*  46: 56 */       rMap.put("data", data);
/*  47:    */       
/*  48: 58 */       rMap.putAll(getParams(model));
/*  49:    */     }
/*  50:    */     catch (Exception ex)
/*  51:    */     {
/*  52: 62 */       ex.printStackTrace();
/*  53:    */       
/*  54: 64 */       rMap.put("success", Boolean.valueOf(false));
/*  55: 66 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/*  56: 68 */         rMap.put("message", ex.getMessage());
/*  57:    */       } else {
/*  58: 72 */         rMap.put("message", "保存数据出错！请稍后重试，或联系系统管理员！");
/*  59:    */       }
/*  60:    */     }
/*  61:    */   }
/*  62:    */   
/*  63:    */   public Map<String, Object> save(Map<String, Object> model)
/*  64:    */   {
/*  65: 82 */     Map<String, Object> params = getParams(model);
/*  66:    */     
/*  67: 84 */     Map<String, Object> config = getConfig(model);
/*  68:    */     
/*  69: 86 */     Map<String, Object> rMap = getRMap();
/*  70:    */     try
/*  71:    */     {
/*  72: 90 */       params.put(MapUtil.getString(config, "module.idCol"), getSqlSessionTemplate().selectOne("core.getKey", "azsb/sltzs"));
/*  73:    */       
/*  74: 92 */       Integer allDatas = (Integer)getSqlSessionTemplate().selectOne(namespace(config) + ".selectOrganNo", params);
/*  75:    */       
/*  76: 94 */       allDatas = Integer.valueOf(allDatas.intValue() + 1);
/*  77:    */       
/*  78: 96 */       String temp = "";
/*  79: 98 */       if (allDatas.intValue() < 10) {
/*  80:100 */         temp = "00" + allDatas;
/*  81:102 */       } else if ((10 <= allDatas.intValue()) && (allDatas.intValue() < 100)) {
/*  82:104 */         temp = "0" + allDatas;
/*  83:    */       } else {
/*  84:108 */         temp = String.valueOf(allDatas);
/*  85:    */       }
/*  86:112 */       params.put("TZS_BH", "【" + FormaterUtil.formatDateValue(new Date(), "yyyy") + " 】 " + temp);
/*  87:    */       
/*  88:114 */       getSqlSessionTemplate().insert(namespace(config) + ".insert", params);
/*  89:    */       
/*  90:116 */       rMap.put("data", getSqlSessionTemplate().selectOne(namespace(config) + ".get", params));
/*  91:    */     }
/*  92:    */     catch (Exception ex)
/*  93:    */     {
/*  94:120 */       ex.printStackTrace();
/*  95:    */       
/*  96:122 */       rMap.put("success", Boolean.valueOf(false));
/*  97:124 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/*  98:126 */         rMap.put("message", ex.getMessage());
/*  99:    */       } else {
/* 100:130 */         rMap.put("message", "保存数据出错！请稍后重试，或联系系统管理员！");
/* 101:    */       }
/* 102:    */     }
/* 103:134 */     return rMap;
/* 104:    */   }
/* 105:    */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.app.azsb.clbztzs.ClbztzsService
 * JD-Core Version:    0.7.0.1
 */